package com.woniuxy.ams.controller;

import com.woniuxy.ams.entity.Menu;
import com.woniuxy.ams.entity.ResultEntity;
import com.woniuxy.ams.service.MenuService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author fyx
 */
@RestController
@RequestMapping("/menu")
public class MenuController {
    private final MenuService menuService;

    public MenuController(MenuService menuService) {
        this.menuService = menuService;
    }

    @RequestMapping("/findAll")
    public ResultEntity<?> findMenus() {
        List<Menu> menuList =  menuService.findMenus();
        return new ResultEntity<>(200, "查询成功", menuList);
    }
}
